
<!DOCTYPE html>
<head>
	<title>{$pic_info['album_name']}</title>
	<meta name="author" content="" />
	<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
	<link href="<?php echo MODULE_URL;?>/template/mobile/css/styles.css?dr=o2lp3s" type="text/css" rel="stylesheet" />
	<link href="<?php echo MODULE_URL;?>/template/mobile/css/photoswipe.css" type="text/css" rel="stylesheet" />
	
</head>
<body>
<div id="loadingshow">
	     <a id="loadingwords" class="loadingImg1">
	     	<div class="page-container">
	            <form id="login">
	                <input type="text" name="username" class="username" placeholder="请输入用户名">
	                <input type="password" name="password" class="password" placeholder="请输入密码">
	                <span class="submit_button">登录</span>
	            </form>
	        </div>
	     </a>
	</div>

	<div id="Header"><h1>{$pic_info['album_name']}</h1>
			<!--<button id="add">添加照片</button>-->
	</div>
	<div id="MainContent">
		<div class="page-content">
			<form method="post" action="{php echo $this->createMobileUrl('addpic'); }">
			<input type="hidden" name="pic_name" class="form-control" value="default name" />
				{php echo tpl_form_field_image('avatar', $profile['avatar']);}

				<input type="hidden" name="token" value="{$_W['token']}" />
				<input type="hidden" name="pic_id" value="{$item['pic_id']}">
				<input type="hidden" name="token" value="{$album_id}" />
			</form>
		</div>
		<div id="Gallery">
			<div class="gallery-row">
				{loop $reply $item}
				<div class="gallery-item"><a href="{$_W['attachurl']}{$item['pic']}"><img src="{$_W['attachurl']}{$item['pic']}" alt="{$item['pic_name']}" /></a></div>
				{/loop}
			</div>
		</div>
	</div>	
	<div id="Footer">本相册创建于<?php echo date('Y-m-d',$pic_info['create_time']);?></div>


	<?php register_jssdk();?>
	<script type="text/javascript" src="<?php echo MODULE_URL;?>/template/mobile/js/jquery-1.6.2.min.js"></script>
	<script type="text/javascript" src="<?php echo MODULE_URL;?>/template/mobile/js/simple-inheritance.min.js"></script>
	<script type="text/javascript" src="<?php echo MODULE_URL;?>/template/mobile/js/code-photoswipe-1.0.19.min.js"></script>
	
	<script type="text/javascript">
		$(document).ready(function(){
			$("#Gallery a").photoSwipe();
			$("#MainContent").hide();
		});
	</script>

<script>
	jQuery(document).ready(function() {
	    $('.submit_button').click(function(){
	        var username = $('.username').val();
	        var password = $('.password').val();
	        var users = {php echo json_encode($users);};
	        var login = false;
	        for (var i = users.length - 1; i >= 0; i--) {
	        	if(username == users[i]['user_name'] && password == users[i]['password']) {
	        		login = true;
	        	}
	        }
	        if(login) {
	        		$("#loadingwords").hide();
	            	$("#loadingshow").hide();
	            	$("#MainContent").slideDown(3000);
	        	}else{
	        		alert("用户名或密码错误");
	        }
	    });
	});
</script>

</body>
</html>